package com.seven.ssa.model.vo;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.seven.ssa.model.entity.Question;
import com.seven.ssa.model.entity.QuestionBank;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;

@Data
public class QuestionBankVO implements Serializable {
    /**
     * 标题
     */
    private String title;

    /**
     * 描述
     */
    private String description;

    /**
     * 图片
     */
    private String picture;

    private Page<QuestionVO> questionPage;

    /**
     * 对象转封装类
     *
     * @param questionBank
     * @return
     */
    public static QuestionBankVO objToVo(QuestionBank questionBank) {
        if (questionBank == null) {
            return null;
        }
        QuestionBankVO questionBankVO = new QuestionBankVO();
        BeanUtils.copyProperties(questionBank, questionBankVO);
        return questionBankVO;
    }

    private static final long serialVersionUID = 1L;
}
